package api

import (
	"github.com/gin-gonic/gin"
	"tie/api/handler"
)

func Router(r *gin.Engine) {
	r.POST("/sendSms", handler.SendSms) //短信验证码
	r.POST("/login", handler.Login)     //登录
	r.POST("/upload", handler.Upload)   //图片上传
	r.POST("/tie/add", handler.TieAdd)  //帖子发布
	r.GET("/tie/list", handler.TieList) //帖子列表
	chat := handler.NewChat()
	r.GET("/chat", chat.Chat)                      //websocket聊天
	r.POST("/foll", handler.Follow)                //关注
	r.POST("/foll/del", handler.FollowDel)         //取消关注
	r.POST("/comment", handler.Comment)            //评论
	r.GET("/comment/list", handler.CommentList)    //评论展示
	r.POST("/comment/del", handler.CommentDel)     //评论删除
	r.POST("/like", handler.Like)                  //点赞
	r.POST("/like/del", handler.LikeDel)           //取消点赞
	r.GET("/tie/show", handler.TieShow)            //帖子详情
	r.POST("/center", handler.Center)              //个人中心
	r.POST("/center/update", handler.CenterUpdate) //个人中心更新
}
